package com.ruoyi.baseData.controller;


import com.ruoyi.baseData.domain.dto.EquipmentTreeDto;
import com.ruoyi.baseData.service.EquipmentTreeService;
import com.ruoyi.common.core.domain.R;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/equipmentTree")
public class EquipmentTreeController {

    @Autowired
    EquipmentTreeService materialService;

    @PostMapping("/getEquipmentTreeByPage")
    public R export(@RequestBody EquipmentTreeDto materialDto)
    {
        return R.ok(materialService.getEquipmentTreeByPage(materialDto));
    }

    @PostMapping("/addEquipmentTree")
    public R addTest(@RequestBody EquipmentTreeDto materialDto){
        materialService.addEquipmentTree(materialDto);
        return R.ok("添加成功");
    }

    @PostMapping("/delEquipmentTree")
    public R delTest(@RequestBody EquipmentTreeDto materialDto){
        materialService.delEquipmentTree(materialDto);
        return R.ok("删除成功");
    }

    @PostMapping("/updateEquipmentTree")
    public R updateTest(@RequestBody EquipmentTreeDto materialDto){
        materialService.updateEquipmentTree(materialDto);
        return R.ok("锁定成功");
    }
}
